package com.ming.multifunction.model.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;


@Data
public class CommentsVO implements Serializable {

    /**
     *  评论留言id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 帖子id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long postId;

    /**
     * '父级评论id'
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "parentID")
    private Long parentID;


    /**
     * 创建时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date createTime;

    /**
     * 评论内容
     */
    private String content;

    /**
     * 回复对象
     */
    private String target;


    /**
     * 评论者的信息
     */
    private UserVO userVO;

    /**
     * 子级评论
     */
    private List<CommentsVO> children;

    private static final long serialVersionUID = 1L;
}